#ifndef PAYOFFFACTORYHELPER_H
#define PAYOFFFACTORYHELPER_H
#include "PayOffFactory.h"

template <typename T>
class PayOffFactoryHelper
{
public:
	PayOffFactoryHelper(std::string payoff_id);
	static PayOff* create(double strike);
};

template <typename T>
PayOffFactoryHelper<T>::PayOffFactoryHelper(std::string payoff_id)
{
	PayOffFactory::Instance().registerPayOff(payoff_id,create);
}
template <typename T>
PayOff* PayOffFactoryHelper<T>::create(double strike)
{
	return new T(strike);
}

#endif